#ifndef EditeurEseo_H
#define EditeurEseo_H

#include <QtGui/QMainWindow>

#include "Editor/EditWidget.h"
#include "Model/BuildingMap.h"

/**
 * Main window class. 
 * \description This is the main window of the editor. It holds the main menu,
 * The tool menu and the scene widget.
 */

class EditeurEseo : public QMainWindow
{
Q_OBJECT
public:
    EditeurEseo();
    virtual ~EditeurEseo();
    
public slots:
    /**
     * Opens a file into the editor, and loads it to the scene.
     * This methods depends of the implementation of FileIO, so 
     * it can be switched from XML to binary.
     * \parameter filename Name of the file to load.
     */
    void openFile(const QString& filename);
    
    /**
     * Opens the "File Open" dialog.
     */
    void showOpenFileDialog();
    
    /**
     * Saves the current file.
     */
    void save();
    
    /**
     * Opens the "Set Background Image" dialog.
     */
    void openBackgroundImageDialog();
    
    /**
     * Opens the "Save As" dialog.
     */
    void saveAs();
    
private:
    Editor::EditWidget *widget;
    QString currentFileName;
    
    // Pointers to the different tools
    Tool* createTool;
    Tool* moveTool;
    Tool* cutTool;
    Tool* doorTool;
    Tool* lightTool;
    
    Model::BuildingMap* currentMap;
    
private slots:
    /* TODO: This methods of many pointers/many slots is awful.
     * Find another way to instanciate the different tools (templates?)
     */
    void setMoveTool();
    void setCreateTool();
    void setCutTool();
    void setDoorTool();
    void setLightTool();
};

#endif // EditeurEseo_H
